package dbgroup02.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import dbgroup02.dao.FlightTicketDao;

public class ShowFlightTicketController implements Controller {
	
	FlightTicketDao flightTicketDao;

	public void setFlightTicketDao(FlightTicketDao flightTicketDao) {
		this.flightTicketDao = flightTicketDao;
	}	

	
	@Override
	@Transactional(readOnly = true, propagation = Propagation.REQUIRED)
	public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
		Map<String, Object> model = new HashMap<String, Object>();
		model.put("flightTicket", flightTicketDao.getFlightTicket(5));		
		return new ModelAndView("showflightticket", model);
	}

}
